package com.powernobug.service.impl;

import com.github.pagehelper.PageHelper;
import com.powernobug.bean.vo.PageVo;
import com.powernobug.bean.vo.data.RoleData;
import com.powernobug.mapper.MarketRoleMapper;
import com.powernobug.service.AdminRoleService;
import com.powernobug.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @Author: 肖云戈
 * @CreateTime: 2024-08-23
 * @Description:
 */
public class AdminRoleServiceImpl implements AdminRoleService {
    private SqlSession tempSession;

    @Override
    public PageVo getAdminByPage() {
        tempSession = MyBatisUtil.getSqlSession();
        MarketRoleMapper marketRoleMapper = tempSession.getMapper(MarketRoleMapper.class);
        PageHelper.startPage(1, 20);
        List<RoleData> marketRoles = marketRoleMapper.selectAll();
        MyBatisUtil.releaseSqlSession(tempSession);
        return PageVo.pag(marketRoles);
    }
}
